//
//  CenterBaseViewController.m
//  Yihubang
//
//  Created by xmy on 2016/12/1.
//  Copyright © 2016年 xmy. All rights reserved.
//

#import "CenterBaseViewController.h"

@interface CenterBaseViewController ()

@end

@implementation CenterBaseViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self setNavgationView];
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
-(void)setNavgationView{
    UIView * navigation =[UIView new];
    [self.view addSubview:navigation];
    UILabel * titleLabel =[UILabel new];
    titleLabel.alpha = 0.4;
    titleLabel.font =[UIFont systemFontOfSize:15.f];
    titleLabel.textColor = [UIColor whiteColor];
    titleLabel.text =@"双击音量键求助";
    [navigation addSubview:titleLabel];
    UIButton * backImg = [UIButton new];
    [backImg setImage:[UIImage imageNamed:@"center-back"] forState:UIControlStateNormal];
    [backImg addTarget:self action:@selector(gotoBack) forControlEvents:UIControlEventTouchUpInside];
    [navigation addSubview:backImg];
    @weakify(self)
    [backImg mas_makeConstraints:^(MASConstraintMaker *make) {
        @strongify(self)
        make.centerY.mas_equalTo(navigation.mas_centerY);
        make.left.equalTo(self.view).with.offset(25);
        make.height.mas_equalTo(@30);
        make.width.mas_equalTo(@30);
    }];
    [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(navigation.mas_centerY);
        make.centerX.mas_equalTo(navigation.mas_centerX);
    }];

    [navigation mas_makeConstraints:^(MASConstraintMaker *make) {
        @strongify(self)
        make.top.equalTo(self.view).with.offset(20);
        make.left.equalTo(self.view).with.offset(0);
        make.right.equalTo(self.view).with.offset(0);
        make.height.mas_equalTo(@44);
    }];

}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
